package cl.uchile.sketchpad.persistance.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name = "uploaded_file")
@JsonIgnoreProperties({"content"})
public class UploadedFile {
	
	private Long id;
	private String originalName;
	private String contentType;
	private String content;
	
	public UploadedFile() {}
	
	public UploadedFile(String contentType, String content) {
		this.contentType = contentType;
		this.content = content;
	}
	
	public UploadedFile(String originalName, String contentType, String content) {
		this.originalName = originalName;
		this.contentType = contentType;
		this.content = content;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "original_name")
	public String getOriginalName() {
		return originalName;
	}
	
	public void setOriginalName(String originalName) {
		this.originalName = originalName;
	}
	
	@Column(name = "content_type")
	public String getContentType() {
		return contentType;
	}
	
	public void setContentType(String contentType) {
		this.contentType = contentType;
	}
	
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	

}
